
// <editor-fold defaultstate="collapsed" desc="LIBRERIAS">                          
import java.awt.Color;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.net.URL;
import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.plaf.IconUIResource;
// </editor-fold>         

public class Label {

    // <editor-fold defaultstate="collapsed" desc="ATRIBUTOS">                          
    public JLabel label;
    public boolean presionado = false;
    public int cantidad_imagenes;
// </editor-fold>         

    // <editor-fold defaultstate="collapsed" desc="CONSTRUCTOR">                          
    public Label(String txt, int Cantidad_imagenes) {
        label = new JLabel(txt);
        label.setBorder(BorderFactory.createTitledBorder(""));
        cantidad_imagenes = Cantidad_imagenes;

    }
// </editor-fold>         

    // <editor-fold defaultstate="collapsed" desc="METODOS">                          
    public void setIcono(String path) {
        label.setIcon(new ImageIcon(getClass().getResource(path)));
    }

    public int getCantidad_imagenes() {
        return cantidad_imagenes;
    }

    public void setCantidad_imagenes(int cantidad_imagenes) {
        this.cantidad_imagenes = cantidad_imagenes;
    }

    public void setTexto(String txt) {
        label.setText(txt);
    }

    public String getTexto() {
        return label.getText();
    }

    public int getPuntaje() {
        return Integer.parseInt(label.getText());
    }

    public void getEvent() {
        MouseListener ml = new MouseListener() {
            @Override
            public void mouseClicked(MouseEvent e) {

                presionado = true;

            }

            @Override
            public void mousePressed(MouseEvent e) {
            }

            @Override
            public void mouseReleased(MouseEvent e) {
                presionado = false;

            }

            @Override
            public void mouseEntered(MouseEvent e) {
            }

            @Override
            public void mouseExited(MouseEvent e) {
            }
        };
        label.addMouseListener(ml);
    }
// </editor-fold>         
}
